package com.laboratory.serviceprovide.mapper;

import com.Laboratory.pojo.user;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface userMapper {

    //获取用户姓名列表
    List<String> getUserNameList();
    //权限相关
    user selectUserByName(String username);
    List<String> getRoleListByName(String username);
    List<String> getAuthorityListByName(String username);
    //登录后展示用户可以直接查看的详情信息
    user getUserDetailByName(String username);
    //更新用户密码
    int updateUserPassword(@Param("username") String username,
                           @Param("newPassword") String newPassword);

    List<user> getUserList();
    List<Map<String,Object>> getRoleList();
    List<Map<String,Object>> getAuthorityList();

    int updateUserAccountStateById(@Param("state")String state, @Param("id")String id);
    int deleteUserById(String id);
    int updateUserAuthorityStateById(@Param("state")String state, @Param("id")String id);
    int updateUserRole(@Param("userId")String userId,@Param("roleName")String roleName);
    int createUser(user user);
    int updateUserMessage(user user);
}